<?php
declare(strict_types=1);
namespace SixShop\Lakala\Model;

use SixShop\Lakala\Enum\WechatOrderStateEnum;
use think\Model;

class LakalaWechatPaymentModel extends Model
{
    protected function getOptions(): array
    {
        return [
            'name' => 'lakala_wechat_payment',
            'type' => [
                'order_state' => WechatOrderStateEnum::class,
            ]
        ];
    }

    public function getOrderStateTextAttr($value, $data)
    {
        return $data['order_state']->toString();
    }
}